﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using PPI.Entities.Lookup;
using VMind.Global;

namespace PPI.Client.Logic
{
    public class LXMissionStructures_PoleSpecies
    {

        public static List<EXMissionStructures_PoleSpecies> SelectAllIdName()
        {
            List<EXMissionStructures_PoleSpecies> _returnList = new List<EXMissionStructures_PoleSpecies>();
            DataTable dt = WebConsumer.WXMissionStructures_PoleSpecies.SelectAllIdName().Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                EXMissionStructures_PoleSpecies specie = new EXMissionStructures_PoleSpecies();
                specie.Id = ConvertHelper.ToInt32(dr["XMissionStructures_PoleSpeciesId"]);
                specie.Name = dr["Name"].ToString();
                _returnList.Add(specie);

            }
            return _returnList;
        }

        //public static void InsertSpecies(string connectionString)
        //{

        //    StringBuilder _query = new StringBuilder();
        //    List<EXMissionStructures_PoleSpecies> _species = LXMissionStructures_PoleSpecies.SelectAllIdName();
        //    foreach (EXMissionStructures_PoleSpecies e in _species)
        //    {
        //        _query.AppendLine("insert into tb_Lookups (LookupValue,LookupText,LookupTypeFk) values (" + e.XMissionStructures_PoleSpeciesId + ",'" + e.Name + "','Species')");
        //    }
        //    Utils.InsertSpecies(connectionString, _query.ToString());
        //}
    }
}
